read write append in text file using C